<?php
$q = $_GET[ 'q'];
$str = 'abcdefghijklmnopqrstuvwxyz1234567890';
$results = array();
$len = rand( 6, 10);
for( $i = 0; $i < $len; $i++ ){
	$begin = rand( 0, 35);
	$end = rand( 0, 35);
	if( $begin > $end){
		$tmp = $end;
		$end = $begin;
		$begin = $tmp;
	}
	$results[] =  $q . '_' . substr( $str,  $begin, $end - $begin > 4 ? 4 : $end - $begin);
}
sleep( 2);
if( mb_strlen( $q) < 5 ){
	echo json_encode( array( $q, $results ) );
}else{
	echo json_encode( array( $q, array() ) );
}
